<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        console.log('输入1~7的数组，显示星期几       // let num=parseInt(prompt("请输入一个星期的数字"));');
        console.log('输入月份显示月份的天数');
        console.log(
            '=================================================================================================');
    </script>
</head>

<body>
    输入1~7的数组，显示星期几 // let num=parseInt(prompt("请输入一个星期的数字"));
    <hr>
    输入月份显示月份的天数

</body>

<script>
    let num = parseInt(prompt("请输入一个星期的数字"));
    switch (num) {
        case 1:
            console.log('星期一');
            break;
        case 2:
            console.log('星期二');
            break;
        case 3:
            console.log('星期三');
            break;
        case 4:
            console.log('星期四');
            break;
        case 5:
            console.log('星期五');
            break;
        case 6:
            console.log('星期六');
            break;
        case 7:
            console.log('星期日');
            break;
        default:
            console.log("输入数字不合法！")
    }
</script>

<script>
    let year = parseInt(prompt("请输入年份："))
    let month = parseInt(prompt("请输入月份："));
    switch (month) {
        case 1:
        case 3:
        case 5:
        case 7:
        case 8:
        case 10:
        case 12:
            console.log(month + "月有31天");
            break;
        case 4:
        case 6:
        case 9:
        case 11:
            console.log(month + "月有30天");
            break;
        case 2:
            if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {
                console.log(month + "月有28天")
            } else {
                console.log(month + "月有29天")
            }
            break;
        default:
            console.log('输入不合法！')

    }
</script>

</html>